﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="departments.aspx.cs" Inherits="Xnjc_departments" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title></title>
    <link href="../css/dtree.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../ScriptFile/dtree.js"></script>

</head>
<body>
    <div style="text-align: left">

        <script type="text/javascript">

        function beSelected(orderID,departName,departID)
        {
	        var frame = parent.frames["leftFrame"];
	        if(frame["setDepartment"]){
		        frame["setDepartment"](departID,departName);
	        }
        }
        function writeDepartment()
        {
            document.writeln("<div class='basetop'>部门</div>");
            <%
            for (int i=0;i<dtDepartInfo.Rows.Count; i++)
            {
	                String departName = dtDepartInfo.Rows[i]["DEPART_NAME"].ToString().Trim();
	                String departID = dtDepartInfo.Rows[i]["DEPARTID"].ToString();
	                String orderID = dtDepartInfo.Rows[i]["ORDER_ID"].ToString();
	                String parentID = dtDepartInfo.Rows[i]["PARENT_ID"].ToString();
	                if(i!=dtDepartInfo.Rows.Count-1)
	                {
		     %>
		            document.writeln("<div class='basemiddle'><span class=\"basespan\"; onclick=\"beSelected(\'<%=orderID%>\',\'<%=departName%>\',\'<%=departID%>\');void(0);\" >&nbsp;&nbsp;&nbsp;<span class=\"spanbase\" onmouseover=\"this.className='spanmouseover'\" onmouseout=\"this.className='spanmouseout'\" ><%=departName%></span></span></div>");
		     <% 
		            }
		            else
		            {
		      %>
		                document.writeln("<div class='baseend'><span class=\"basespan\"; onclick=\"beSelected(\'<%=orderID%>\',\'<%=departName%>\',\'<%=departID%>\');void(0);\" >&nbsp;&nbsp;&nbsp;<span class=\"spanbase\" onmouseover=\"this.className='spanmouseover'\" onmouseout=\"this.className='spanmouseout'\" ><%=departName%></span></span></div>");
		      <%
		            }		            
		    }		        
		     %>
        }
        writeDepartment();
        </script>

    </div>
</body>
</html>

